package org.clxmm.security03springboot.service;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.clxmm.security03springboot.Dao.User;
import org.clxmm.security03springboot.mapper.UserMapper;
import org.springframework.stereotype.Service;

/**
 * @author clxmm
 * @Description
 * @create 2021-06-12 4:47 下午
 */
@Service
public class UserService extends ServiceImpl<UserMapper,User> {




    public User getUserByUserName(String username) {
        LambdaQueryWrapper<User> userLambdaQueryWrapper = new LambdaQueryWrapper<>();

        userLambdaQueryWrapper.eq(User::getUsername,username);

        return baseMapper.selectOne(userLambdaQueryWrapper);
    }
}
